Skip to content

Conversation

@Anbukannadhasan
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the tapoControl module to support newer Tapo devices and improves the code quality through better null checking and consistent state management. The changes include upgrading dependencies to support new API versions and refactoring power control logic.

  • Updated numpy to version >=2.0.0,<2.3.0 and python-kasa to 0.7.7 to support newer device features
  • Refactored outlet/state checking to use explicit is not None comparisons instead of truthy checks
  • Replaced property accessors (is_on/is_off) with direct _is_on attribute usage for consistency
  • Enhanced power monitoring to support multi-outlet devices with updated API calls

Reviewed Changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 5 comments.

File Description
requirements.txt Updated numpy, python-kasa, and typing_extensions to newer versions
framework/core/powerModules/tapoControl.py Refactored state management, outlet checking, added support for Children device type, and updated power monitoring implementation
Comments suppressed due to low confidence (2)

framework/core/powerModules/tapoControl.py:187

  • The _performCommand method doesn't accept a noArgs parameter. According to the method signature at line 84, it only accepts command, json, and append_args parameters. This will cause a TypeError at runtime.
            result = self._performCommand("state", noArgs=True)

framework/core/powerModules/tapoControl.py:203

  • The attribute self.slotIndex is referenced but never defined in the class. This will raise an AttributeError at runtime. It appears this should be int(self._outlet) based on the outlet handling elsewhere in the code.
                if powerState[self.slotIndex+1] == "OFF":

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@TB-1993 TB-1993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of the copilot suggestions are good too

Copy link
Contributor Author

@Anbukannadhasan Anbukannadhasan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed review comments

Copy link
Contributor

@TB-1993 TB-1993 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, ship it!

@TB-1993 TB-1993 merged commit e59cc09 into develop Nov 14, 2025
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants